/*
 * server_node.cpp
 *
 * Created on: Nov 21, 2023 16:16
 * Description:
 *
 * Copyright (c) 2023 Chongqing Xuyu Dong Technology Co,. Ltd.
 */


#include <memory>

#include <ros/ros.h>

#include "mower_msgs/node_status.h"
#include "mower_msgs/node_status_define.h"
#include "mower_msgs_test.hpp"

ros::Publisher  status_pub_; 

int main(int argc, char **argv) {
  // setup ROS node
  ros::init(argc, argv, "mower_msgs_test_node");
  ros::NodeHandle node(""), private_node("~");   


  status_pub_ = private_node.advertise<mower_msgs::node_status>("node_status_msg",5);   
  
  uint32_t send_time  = 0;
  mower_msgs::node_status status_msg;
  mower_msgs::node_status_define status_define;

  ros::Rate rate(1);

  while (ros::ok()) {     

    send_time ++ ;
    status_msg.module_id = status_define.Location;
    status_msg.status = status_define.Location_NORMAL;
    status_msg.send_times = send_time;

    status_pub_.publish(status_msg);


    ros::spinOnce();
    rate.sleep();
  }


  return 0;
}
